const im = Vue => {
	const http = uni.$u.http
	// 获取 im Token
	let getImToken = (params) => http.get('/v1_0/member/Im/getToken', params)

	// im 进入APP时全局检测
	let imWindowGlobal = (params, config = {
		custom: {
			catch: true
		}
	}) => http.get('/v1_0/member/im/imWindowGlobal', params, config)
	// 发起聊天检测
	let startConversation = (params, config = {
		custom: {
			catch: true
		}
	}) => http.post('/v1_0/member/im/startConversation', params, config)
	// 获取系统消息列表
	let getSystemMsgList = (params) => http.get('/v1_0/member/account/msglist', params)
	// 获取聊天列表数据
	let getChatList = (params, config = {}) => http.post('/v1_0/member/Im/chatList', params, config)
	// 聊天是否置顶
	let getChatStick = (params) => http.post('/v1_0/member/im/chatStick ', params)
	// 删除聊天
	let getRemoveChat = (params) => http.post('/v1_0/member/Im/removeChat', params)
	// 获取消息列表数据
	let getMessageList = (params) => http.post('/v1_0/member/Im/messageList', params)
	// 检测对方是否在黑名单
	let getBlacklistCheck = (params, config = {}) => http.post('/v1_0/member/im/blacklistCheck', params, config)
	// 添加黑名单
	let getBlacklistAdd = (params) => http.post('/v1_0/member/im/blacklistAdd', params)
	// 删除黑名单
	let getBlacklistDel = (params) => http.post('/v1_0/member/im/blacklistDel', params)
	// 申请职位
	let getJobApplyAdd = (params) => http.post('/v1_0/member/index/jobApplyAdd', params)
	// 获取常用语列表
	let getPhraseList = (params) => http.post('/v1_0/member/im/phraseList', params)
	// 删除常用语
	let getPhraseDel = (params) => http.post('/v1_0/member/im/phraseDel', params)
	// 修改常用语
	let getPhraseEdit = (params) => http.post('/v1_0/member/im/phraseEdit', params)
	// 添加常用语
	let getPhraseAdd = (params) => http.post('/v1_0/member/im/phraseAdd', params)
	// 聊天关键字屏蔽
	let keywordReplace = (params) => http.get('/v1_0/member/im/keywordReplace', params)

	// 获取面试邀请记录
	let getInterviewList = (params) => http.get('/v1_0/personal/interview/index', params)
	// 设置面试邀请为已查看
	let getInterviewSetLook = (params) => http.post('/v1_0/personal/interview/setLook', params)
	Object.assign(uni.$u.api, {
		getImToken,
		imWindowGlobal,
		startConversation,
		getSystemMsgList,
		getChatList,
		getChatStick,
		getRemoveChat,
		getMessageList,
		getBlacklistCheck,
		getBlacklistAdd,
		getBlacklistDel,
		getJobApplyAdd,
		getPhraseList,
		getPhraseDel,
		getPhraseEdit,
		getPhraseAdd,
		keywordReplace,
		getInterviewList,
		getInterviewSetLook
	})
}

export default im